<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/zepto.js"></script>
</head>
<body>
    <script>
        let array = [];
        for(let i=1;i<=100;i++){
          array[i]=[];
          //随机去性别
          let num=Math.floor(Math.random()*2);
          if (num==1){
            let gender='boy';
            array[i].push(gender);
          }else{
            let gender='girl';
            array[i].push(gender);
          }
          //随机取是否单身
          let num2=Math.floor(Math.random()*2);
          if (num2==1){
            let situation='单身';
            array[i].push(situation);
          }else{
            let situation='非单身';
            array[i].push(situation);
          }
      
          //随机取年龄
          let age = Math.floor(Math.random()*(30-10+1))+10;
          array[i].push(age);
      
          //随机取身高
          let length = Math.floor(Math.random()*(190-150+1)+150);
          array[i].push(length);
        }
        console.log(array)
      
        Zepto(function($) {
          grep($);
        })


        function grep($) {
            let array1 = $.grep(array, function(item) {
                return item[0]=='girl'&&item[1]=='单身'&&item[2]>=18&&item[2]<=25&&item[3]>=155&&item[3]<=172;
            })
            console.log(array1)
        }
      </script>
</body>
</html>